package com.wunong.smart.collection.application.request;

import com.wunong.smart.collection.client.param.CollectParam;
import com.wunong.smart.domain.platform.common.BizSource;
import com.wunong.smart.domain.platform.entify.User;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author create by zealot.zt
 */
@Getter
@Setter
@ToString(callSuper = true)
public class CollectRequest extends BaseCollectionRequest {

    /**
     * 业务来源信息
     */
    private BizSource source;

    /**
     * 用户信息
     */
    private User user;

    /**
     * 收藏类型
     */
    private String collectType;

    public static CollectRequest of(CollectParam param) {
        CollectRequest request = new CollectRequest();

        request.initBasic(param);
        request.setSource(BizSource.of(param.getBizId(), param.getBizType()));
        request.setUser(User.of(param.getUserId(), param.getUserRole()));
        request.setCollectType(param.getCollectType());

        return request;
    }

    @Override
    public Long getCollectionId() {
        return null;
    }

}
